<?php
// $Id: block.tpl.php,v 1.3 2007/08/07 08:39:36 goba Exp $
?>

<?php //dsm($form); ?>
<?php //dsm($event); ?>
<?php print $form ?>



<table>
<?php if ($series['nid'] > 0): ?>
  <tr>
    <th colspan = "13"><?php print $series['title']?></th>
  </tr>
  <?php endif; ?>
<?php if ($event['nid'] > 0): ?>
  <tr>
    <th colspan = "13"><?php print $event['title']?></th>
  </tr>
  <?php endif; ?>
<?php if (!(($series['nid'] > 0) OR ($event['nid'] > 0))): ?>
  <tr>
    <th colspan = "13"><?php print t('All events')?></th>
  </tr>
<?php endif; ?>
  <tr>
    <th>&nbsp;</th>
    <th colspan = "4"><?php print t('total')?></th>
    <th colspan = "4"><?php print t('home')?></th>
    <th colspan = "4"><?php print t('away')?></th>
  </tr>
  
  <tr>
    <th><?php print t('Player')?></th>
    <th><?php print t('P')?></th>
    <th><?php print t('W')?></th>
    <th ><?php print t('D')?></th>
    <th ><?php print t('L')?></th>
    <th><?php print t('P')?></th>
    <th><?php print t('W')?></th>
    <th ><?php print t('D')?></th>
    <th ><?php print t('L')?></th>
    <th><?php print t('P')?></th>
    <th><?php print t('W')?></th>
    <th ><?php print t('D')?></th>
    <th ><?php print t('L')?></th>
  </tr>
  <?php if ($event['count'] == 0): ?>
  <tr>
    <th colspan = "13"><?php print t('No matches')?></th>
  </tr>
  <?php elseif ($event['count'] > 0): ?>
  <?php $row = 1 ?>
  <?php foreach ($players as $player): ?>
    <tr class='<?php print ($row % 2 == 0) ? 'odd' : 'even' ?>'>
      <td><?php print $row ?>.&nbsp;<?php print $player['title'] ?></td>
      <td><?php print $player['total_points'] ?></td>
      <td><?php print $player['total_wins'] ?></td>
      <td><?php print $player['total_draws'] ?></td>
      <td><?php print $player['total_loses'] ?></td>
      <td><?php print $player['home_points'] ?></td>
      <td><?php print $player['home_wins'] ?></td>
      <td><?php print $player['home_draws'] ?></td>
      <td><?php print $player['home_loses'] ?></td>
      <td><?php print $player['away_points'] ?></td>
      <td><?php print $player['away_wins'] ?></td>
      <td><?php print $player['away_draws'] ?></td>
      <td><?php print $player['away_loses'] ?></td>
    </tr>
    <?php $row++; ?>
  <?php endforeach; ?>
  <?php endif; ?>
</table>